#include <stm8s_flash.h>

#if defined (_SDCC_)    
  uint32_t    asm_addr;      // 16b/24b address
  uint8_t     asm_val;       // 1B data for r/w data

uint8_t read_byte_address(uint32_t Address)
{
  /* store address globally for assember */
  asm_addr = Address;

  /* use inline assembler to read from 16b/24b address */
__asm
  ldf	a,[_asm_addr+1].e
  ld	_asm_val,a
__endasm;
  /* return read byte */
  return(asm_val);
  
}

#endif // _SDCC_
/**
  * @}
  */
  


/** @addtogroup FLASH_Public_functions
  * @{
  */

/**
  * @brief  Unlocks the program or data EEPROM memory
  * @param  FLASH_MemType : Memory type to unlock
  *         This parameter can be a value of @ref FLASH_MemType_TypeDef
  * @retval None
  */
